<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<%@page import="persistence.QuoteVO"%>
<%@page import="persistence.QuoteEngineDAO"%><html>
<head>
	<link rel="stylesheet" href="css/demos.css" media="screen" type="text/css">
	<script type="text/javascript" src="dhtml-suite.js"></script>
</head>
<body>

<% 
		System.out.println(request.getParameter("date"));
		java.util.List<QuoteVO> lsQuote = (new QuoteEngineDAO()).listQuote(request.getParameter("date"));
%>
<%=request.getParameter("date")%>
<div>
<table id="quote">
	<thead>
		<tr>
			<td>stock</td>
			<td>name</td>
			<td>open</td>
			<td>close</td>
			<td>high</td>
			<td>low</td>
			<td>volume</td>
		</tr>
	</thead>
	<tbody>
<%
	for(int x=0; x<lsQuote.size(); x++) { 
			QuoteVO vo = lsQuote.get(x);
%>	
		<tr>
			<td><%=vo.getStock()%></td>
			<td><%=vo.getName()%></td>
			<td><%=vo.getOpen()%></td>
			<td><%=vo.getOpen()%></td>
			<td><%=vo.getHigh()%></td>
			<td><%=vo.getLow()%></td>
			<td><%=vo.getVolume()%></td>
		</tr>
<% } %>
	</tbody>
</table>
</div>

<script type="text/javascript">

var tableWidgetObj_demo2 = new DHTMLSuite.tableWidget();
tableWidgetObj_demo2.setTableId('quote');
tableWidgetObj_demo2.setTableWidth(450);
tableWidgetObj_demo2.setTableHeight(250);
tableWidgetObj_demo2.setColumnSort(Array('S','S',false,false,false,false,'N'));
tableWidgetObj_demo2.init();
tableWidgetObj_demo2.sortTableByColumn(1);// Initially sort the table by the second column
</script>
<br>

</body>
</html>